home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / pulseaudio.postinst < prev    next >
Encoding:
Text File  |  2009-07-14  |  1.7 KB  |  63 lines

  1. #! /bin/sh
  2. # postinst script for pulseaudio
  3.  
  4. set -e
  5.  
  6. # summary of how this script can be called:
  7. #        * <postinst> `configure' <most-recently-configured-version>
  8. #        * <old-postinst> `abort-upgrade' <new version>
  9. #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  10. #          <new-version>
  11. #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  12. #          <failed-install-package> <version> `removing'
  13. #          <conflicting-package> <version>
  14. # for details, see http://www.debian.org/doc/debian-policy/ or
  15. # the debian-policy package
  16.  
  17. PULSEAUDIO=/usr/bin/pulseaudio
  18.  
  19. case "$1" in
  20.   configure)
  21.     if ! getent passwd pulse >/dev/null; then
  22.       adduser --disabled-password  --quiet --system \
  23.         --home /var/run/pulse --no-create-home\
  24.         --gecos "PulseAudio daemon" --group pulse
  25.       adduser --quiet pulse audio
  26.     fi
  27.     if ! getent group pulse-access >/dev/null; then
  28.       addgroup --quiet --system pulse-access
  29.     fi
  30.     if ! getent group pulse-rt >/dev/null; then
  31.       addgroup --quiet --system pulse-rt
  32.     fi
  33.  
  34.     if ! dpkg-statoverride --list "$PULSEAUDIO" > /dev/null 2>&1; then
  35.        chmod 4755 "$PULSEAUDIO"
  36.     fi
  37.  
  38.     if dpkg --compare-versions "$2" lt-nl "0.9.14-0ubuntu9"; then
  39.     update-rc.d -f pulseaudio remove
  40.     fi
  41.   ;;
  42.   abort-upgrade|abort-remove|abort-deconfigure)
  43.   ;;
  44.   *)
  45.     echo "postinst called with unknown argument \`$1'" >&2
  46.     exit 1
  47.   ;;
  48. esac
  49.  
  50. # Automatically added by dh_installinit
  51. if [ -x "/etc/init.d/pulseaudio" ]; then
  52.     update-rc.d pulseaudio start 50 2 3 4 5 . stop 15 1 . >/dev/null
  53.     if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
  54.         invoke-rc.d pulseaudio start || exit $?
  55.     else
  56.         /etc/init.d/pulseaudio start || exit $?
  57.     fi
  58. fi
  59. # End automatically added section
  60.  
  61.  
  62. exit 0
  63.